 <meta charset="utf-8">
 <div class="box" id="biz_bizpointDim_assign_conatainer" style="height: 600px;overflow-y: scroll;">
            <div class="box-header with-border">
               <form id="searchForm" role="form" class="form-inline">
                    <div class="form-group">
                         <label>维度名称</label>
                         <input name="name"  v-model="searchForm.name"  v-bind:value="searchForm.name"  type="text" placeholder="" class="form-control input-sm">
                    </div>
                  <button type="button"  class="btn btn-info pull-right m-t-n-xs" v-kperms="{perm:''}" v-on:click="search"><strong>查询</strong></button>
                </form>
            </div>
 <div class="box-body">
 	                       <div class="btn-group " id="authPermTableToolbar" role="group">
 	                       			<button type="button" v-kperms="{perm:''}"  class="btn btn-default" v-on:click="addDimsToBiz">
                                        <i class="glyphicon glyphicon-plus" aria-hidden="true"></i> 添加
                                    </button>
                                  
                                    <button type="button"  v-kperms="{perm:''}" class="btn btn-default" v-on:click="removeDimsFromBiz">
                                        <i class="glyphicon glyphicon-trash" aria-hidden="true"></i> 移除
                                    </button>
                           </div>
           <table id="bizpointDimBootstrapTable" data-mobile-responsive="true" ></table>
 </div>

<script>
var newa=new Vue({  
	  el: '#biz_bizpointDim_assign_conatainer', 
	  data:{
		  	searchForm:{
		  		isIn: 1,
		  		name: null,
		  		bizpointId: null,
		  		status: 1
		  	},
	    	bus:new Vue()
	  },
	  mounted:function(){
		 var _this=this;
		 var param=zfesLayerEditDg.getLayerParam();//
		 _this.searchForm.bizpointId=param.bizpointId;
		 _this.initTable();
	  },
    methods: {
  	  initTable:function(){
  		var _this=this;
  		 var columns=[
				{checkbox:true,width:16},
				{field:'name',title:'聚合维度名称',width:160,sortable:true,formatter: _this.formatLink},
				{field:'status',title:'聚合维度状态',width:60,formatter:_this.formatStatus},
				{field:'remark',title:'备注',width:160}];
		  var url="/agg/admin/dimension/loadDimensionDataSet";
		  
    	  zfesBstable.vueLoadTable($("#bizpointDimBootstrapTable"),$("#authPermTableToolbar"),url,columns,_this.searchForm);
  	  },
	  	formatStatus: function(value, row, index ){
	  	  if(0==value){
	  		  return '<span class="label label-warning">禁用</span>';
	  	 }if(1==value){
	  		  return '<span class="label label-success">正常</span>';
	  	 }else{return value;}
	  }, 
  	  search:function(){
  		  zfesBstable.reload($("#bizpointDimBootstrapTable")); 
  	  },
  	  refresh:function(){
  		  zfesBstable.refresh($("#bizpointDimBootstrapTable"));
  	  },
  	removeDimsFromBiz: function(){
  	 	 if(zfesBstable.isSelectedRow($("#bizpointDimBootstrapTable"))){
			  var ids=zfesBstable.getRowIds($("#bizpointDimBootstrapTable"));
			  var _this=this;
				 alertSwal.confirm("移除该数据","是否执行该操作",function(){
					    var ajaxUrl = "/agg/admin/bizpoint/removeDimsFromBiz";
					    zfesAjax.ajaxTodo(ajaxUrl, { "dimIds" : ids,"id":_this.searchForm.bizpointId}, function(data) {
							alertSwal.successText(data.message);
							_this.refresh();
					});
		  		});
		  }
  	  },
  	addDimsToBiz: function(){
  		var _this=this;
    	var url="/view/datav/bizpoint/bizpoint.dim.assign.lookback.html";
    	var param={bizpointId:_this.searchForm.bizpointId}
    	zfesLayerEditDg.lookback(url, param, "选择维度", 660, function() {
    		_this.refresh();
    	})
  	  }
   	
   }

});
</script>
 </div>

